/*
 * @lc app=leetcode.cn id=2 lang=javascript
 *
 * [2] 两数相加
 */

// @lc code=start
/**
 * Definition for singly-linked list.
 * function ListNode(val, next) {
 *     this.val = (val===undefined ? 0 : val)
 *     this.next = (next===undefined ? null : next)
 * }
 */
/**
 * @param {ListNode} l1
 * @param {ListNode} l2
 * @return {ListNode}
 */
var addTwoNumbers = function (l1, l2) {
  const num1 = l1.reduce((a, b) => a * 10 + b)
  const num2 = l2.reduce((a, b) => a * 10 + b)
  const result = num1 + num2
  const arr = []
  arr.
  while (result > 0) {
    const item = result % 10
    result = result / 10
    arr.push(item)
  }
  return arr
}

console.log(addTwoNumbers([2, 4, 3], [5, 6, 4]))
// @lc code=end
